import java.sql.Connection;
import java.sql.PreparedStatement;

//修改部门信息
public class Demo04 {
    public static void main(String[] args) throws Exception {
         //1.搭桥 开门
        Connection conn = DBHelper.getConn();
        //2. sql
        String sql="UPDATE `dept` SET `deptName` = ?, `address` = ? WHERE `did` = ?";
        //3. 创建仓库管理员
        PreparedStatement ps = conn.prepareStatement(sql);
        //4.给？赋值
        ps.setString(1,"ak48");
        ps.setString(2,"暂无");
        ps.setInt(3,7);
        //5.执行sql
        ps.executeUpdate();

        //6.关门
        DBHelper.close(ps,conn);

    }
}
